{include file="pub/header"}
<title>添加目录</title>
</head>
<body>
<article class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-change_password">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">
                <span class="c-red">*</span>原密码：
            </label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="password" class="input-text" name="password">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>新密码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="password" class="input-text" value="" placeholder="" id="new_password" name="new_password">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>确认密码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="password" class="input-text" value="" placeholder="" name="new_password1">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>

{include file="pub/footer" /}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    $(function () {

        $("#form-change_password").validate({
            rules: {
                password: {
                    required: true
                },
                new_password: {
                    required: true
                },
                new_password1: {
                    required: true,
                    equalTo: "#new_password"
                },
            },
            messages: {
                password:'原密码不能为空',
                new_password:'新密码不能为空',
                new_password1:{
                    required:"确认密码不能为空",
                    equalTo:'两次密码不同'
                }
            },
            onkeyup: false,
            focusCleanup: false,
            success: "valid",
            submitHandler: function (form) {
                $(form).ajaxSubmit(function (res) {
                    if (1 == res.code) {
                        layer.msg(res.msg, {icon: 6, time: 1000});
                        setTimeout(function () {
                            parent.location.reload();
                        }, 1000);
                    } else {
                        layer.msg(res.msg, {icon: 5, time: 1000});
                    }
                });

            }
        });
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>